﻿using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using ControleRepresentante.Logic.Models;
using Telerik.Web.Mvc.UI.Fluent;

namespace WebSite.ViewModels.EditViewModels.EditGridViewModels
{
    public class UsuarioEditGridViewModel : EditGridViewModel<UserViewModel>
    {
        public UsuarioEditGridViewModel(HtmlHelper htmlHelper, string controllerName, IEnumerable<User> users, string routeKey)
            : base(htmlHelper, "User", controllerName, users.Select(x => new UserViewModel(x)), routeKey, false)
        {
        }

        protected override void Columns(GridColumnFactory<UserViewModel> configurator)
        {
            configurator.Bound(user => user.Username);
            configurator.Bound(user => user.Email);
            configurator.Bound(user => user.Ativo);
        }
    }
}